import torch as pt
from python_ai.common.xcommon import *

pt.set_printoptions(edgeitems=100)

sep('3x4')
x = pt.arange(1, 3*4+1).view(3, 4) - 1
print(x)

x = x.view(-1, 1)
print(x)

oh_template = pt.zeros(len(x), 3*4)
print(oh_template)

oh = oh_template.scatter(1, x, 1)
print(oh)

oh = oh.view(3, 4, 3*4)
print(oh)
